
<div class="context">
      <form method="get" action="<?php echo $this->Html->url(array('controller'=> 'default','action'=>'search')); ?>" name="frmSearch" id="frmSearch" class="frmSearch">
        <span class="searchBox">
        <input type="text" value="Tìm kiếm" id="txtSearch" name="q" />
        <a href="javascript:void();" id="quick-search-submit" title="Search">&nbsp;</a> </span> <a href="javascript:void();" title="Tìm kiếm nâng cao" class="linkSearch">Tìm kiếm nâng cao</a>
        <input type="hidden" value="001897934961332779774:ysd417-tqpk" name="cx" />
        <input type="hidden" value="FORID:10" name="cof">
        <input type="hidden" value="UTF-8" name="ie">
      </form>
  <!--frmSearch-->
  <ul class="sideBar">
    <li class="first"> <a href="<?php echo $this->Html->url(array('controller' => 'trai-cay-noi.html')); ?>" title="TRÁI CÂY NỘI"><?php echo $this->Html->image('img_fruit_01.jpg', array('width'=>'58','height'=>'43', 'alt'=>'TRÁI CÂY NỘI')); ?><span>TRÁI CÂY NỘI</span> </a>
      <ul class="hidden">
        <li class="first"><a href="#" title="Bưởi">Bưởi</a></li>
        <li><a href="#" title="Xoài">Xoài</a></li>
        <li><a href="#" title="Nhãn">Nhãn</a></li>
      </ul>
    </li>
    <li> <a href="<?php echo $this->Html->url(array('controller' => 'trai-cay-ngoai.html')); ?>" title="TRÁI CÂY NGOẠI"> <?php echo $this->Html->image('img_fruit_02.jpg', array('width'=>'58','height'=>'43', 'alt'=>'TRÁI CÂY NGOẠI')); ?><span>TRÁI CÂY NGOẠI</span> </a>
      <ul class="hidden">
        <li class="first"><a href="#" title="Bưởi">Bưởi</a></li>
        <li><a href="#" title="Xoài">Xoài</a></li>
      </ul>
    </li>
    <li> <a href="<?php echo $this->Html->url(array('action'=>'index','controller'=> 'requests')); ?>" title="COMBO"> <?php echo $this->Html->image('img_fruit_03.jpg', array('width'=>'58','height'=>'43', 'alt'=>'COMBO')); ?><span>COMBO</span> </a> </li>
    <li> <a href="<?php echo $this->Html->url(array('action'=>'index','controller'=> 'gifts')); ?>" title="QUÀ CƯỚI HỎI"> <?php echo $this->Html->image('img_fruit_04.jpg', array('width'=>'58','height'=>'43', 'alt'=>'QUÀ CƯỚI HỎI')); ?><span>QUÀ CƯỚI HỎI</span> </a> </li>
    <li> <a href="<?php echo $this->Html->url(array('action'=>'index','controller'=> 'baskets')); ?>" title="GIỎ TRÁI CÂY"> <?php echo $this->Html->image('img_fruit_05.jpg', array('width'=>'58','height'=>'43', 'alt'=>'GIỎ TRÁI CÂY')); ?><span>GIỎ TRÁI CÂY</span> </a> </li>
  </ul>
  <!--sideBar-->
        <?php
            if(isset($best_buy_product[0])):
            $total_product =   sizeof($best_buy_product);
        ?>
        <!--Mach nho-->
        <div class="blockProSell">
          <h3>Sản phẩm bán chạy</h3>
          <ul>
            <?php
                $i = 1;
            foreach($best_buy_product AS $row):
                $class_css  =   '';
                if($i == $total_product){
                    $class_css  =   ' class="last"';
                }
            ?>
            <li<?php echo $class_css; ?>> <a href="<?php echo $this->Html->url(array('controller'=>'gio-trai-cay', 'action'=>'chi-tiet-gio-trai-cay', "{$row['Basket']['id']}-{$row['Basket']['alias']}")); ?>" title="<?php echo $row['Basket']['title']; ?>">
            <?php echo $this->Html->image($basket_image_thumb_url_path . $row['Basket']['images_small'], array('alt'=>$row['Basket']['title'])); ?>
            <span><?php echo $row['Basket']['title']; ?></span> </a> </li>
            <?php
                $i++;
            endforeach; ?>
          </ul>
        </div>
        <!--blockProSell-->
        <?php endif; ?>
</div>
<!--end context-->
<div class="content">
  <h3 class="titlePage">SẢN PHẨM</h3>
  <div class="productBlock">
    <?php
        $row_index  =   0;
        $total_product  =   sizeof($data);

        foreach($data AS $row):
        if($row_index == 0){
            echo '<ul class="lstProduct">';
            $product_class_css  =   ' class="first"';
        }else{
            $product_class_css  =   '';
        }
    ?>
      <li<?php echo $product_class_css;?>><a href="<?php echo $this->Html->url(array('controller'=>'dat-gio-trai-cay', 'action'=>'chi-tiet-dat-gio-trai-cay', "{$row['Request']['id']}-{$row['Request']['alias']}")); ?>" title="<?php echo $row['Request']['title']; ?>"><?php echo $this->Html->image($request_image_thumb_url_path . $row['Request']['images_small'], array('alt'=>$row['Request']['title'],'width'=>'221', 'height'=>'177')); ?></a>
        <p class="detailBlock"> <span class="title"><a href="<?php echo $this->Html->url(array('controller'=>'dat-gio-trai-cay', 'action'=>'chi-tiet-dat-gio-trai-cay', "{$row['Request']['id']}-{$row['Request']['alias']}")); ?>" title="<?php echo $row['Request']['title']; ?>"><?php echo $row['Request']['title']; ?></a></span> <span class="price"><?php echo $row['Request']['price']; ?>VNĐ</span> 
              <?php
                if($row['Request']['status'] == 3){
              ?>
              <a class="btn-new-buy" title="Hết hàng" href="<?php echo $this->Html->url(array('controller'=>'gio-trai-cay', 'action'=>'chi-tiet-gio-trai-cay', "{$row['Request']['id']}-{$row['Request']['alias']}")); ?>">
                  <?php echo $this->Html->image('new-button-clearn.png', array('alt'=> 'Hết hàng')); ?>
              </a>
              <?php
                }else{
              ?>
              <a class="btn btnType-4" title="Mua hàng" href="<?php echo $this->Html->url(array('controller'=>'gio-trai-cay', 'action'=>'chi-tiet-gio-trai-cay', "{$row['Request']['id']}-{$row['Request']['alias']}")); ?>"><span><span>
                          <?php echo $this->Html->image('icon_arrow_03.png', array('height'=>'11','width'=>'6', 'alt'=> 'Mua hàng')); ?>
              Mua hàng</span></span></a>
              <?php } ?>
        </p>
      </li>
      <?php
        $row_index++;
        if($row_index==3 || $row_index == ($total_product)){
            $row_index=0;
            echo '</ul>';
        }
        endforeach;
      ?>
    <!--end lstProduct-->
  </div>
  <!--end productBlock-->
  <?php echo $this->element('paging', array('paging'=>$this->Paginator));?>
  <!--paging-->
</div>
<!--end content-->